<?php

namespace app\admin\validate;

use app\validate\BaseValidate;

class ProductSpecsValue extends BaseValidate
{
    /**
     * 定义验证规则
     * 格式：'字段名'=>['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id' => 'number',
        'value' => 'require',
        'specs_name_id' => 'require|number'
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'=>'错误信息'
     *
     * @var array
     */
    protected $message = [];
    /**
     * 定义验证场景
     * 格式：'场景名'=>['规则1','规则2',...]
     *
     * @var array
     */
    protected $scene = [
        'save' => ['value', 'specs_name_id'],
        'delete' => ['id'],
        'update' => ['id', 'value', 'specs_name_id'],
        'read' => ['id']
    ];
}
